
const express = require("express")
const path = require('path');
const app = express();
const p = path.resolve(__dirname,"../public");



const cookieParser = require("cookie-parser");

app.use(cookieParser());//使用第三方cookie解析库
app.use(require('./cookieMiddle'));
// app.use(require("./cookieMiddle"));
app.use(express.static(p));//设置静态资源

app.use(express.urlencoded({extended:true}));// 解析 application/x-www-form-urlencoded 格式的请求体
app.use(express.text({inflate:true,type:"text/x-markdown"}));
app.use(express.json())// 解析 application/json 格式的请求体


app.use("/api/book",require("../Api/book"));

app.use('/api/user',require('../Api/user'));//user相关的api路由
app.use("/api/Andr",require("../Api/Andr"));
app.use("/api/admin",require("../Api/admin"));
const port = 10000;

app.listen(port,()=>{
    console.log(`服务器启动监听${port}端口`);
})